package com.grantheath.erebus.controller.transitionManagers.linearTransitionManagers
{
	import com.grantheath.erebus.model.enum.notifications.ErebusAssetLoaderNotifications;
	import com.grantheath.erebus.model.interfaces.IErebusAssetLoaderProxy;
	import com.grantheath.erebus.model.enum.names.ErebusProxyNames;
	import com.grantheath.erebus.model.interfaces.IErebusAssetNode;

	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	/**
	 * @author grantheath
	 */
	public class ErebusLoadAssetCommand extends SimpleCommand implements ICommand 
	{
		override public function execute(notification : INotification) : void
		{
			var assetNode : IErebusAssetNode = notification.getBody() as IErebusAssetNode;
			var assetLoader : IErebusAssetLoaderProxy = facade.retrieveProxy(ErebusProxyNames.ASSET_LOADER_PROXY) as IErebusAssetLoaderProxy;
			
			assetLoader.loadAsset(assetNode);
			sendNotification(ErebusAssetLoaderNotifications.ASSET_LOADING, assetNode);
		}
	}
}
